package com.leo.springbootmultithreadbasic.singleton.ehan;

/**
 * @author Leo
 * @version V1.0
 */
public class MainDemo {
    public static void main(String[] args) {
        test();
    }

    /**
     * 测试场景：立即加载/“饿汉模式”
     *
     * 测试结果：hashCode相等，拿的是同一个对象
     *
     */
    public static void test() {
        MyThread myThread = new MyThread();
        MyThread myThread2 = new MyThread();
        MyThread myThread3 = new MyThread();

        myThread.start();
        myThread2.start();
        myThread3.start();
    }
}
